﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JHT.EFMigrationTest.ClassLibrary1
{
    public class TestDbContextInitializer : DropCreateDatabaseAlways<TestDbContext>
    {
        protected override void Seed(TestDbContext context)
        {
            base.Seed(context);

            List<Books> seedBook = new List<Books>()
            {
                new Books(){ BookAuthor="zx",Edition=1,BookName="C#",BookNo="2018070301" },
                new Books(){ BookAuthor="zx2",Edition=2,BookName="VB",BookNo="2018070302" },
                new Books(){ BookAuthor="zx3",Edition=3,BookName="JavaScript",BookNo="2018070303" },
                new Books(){ BookAuthor="zx4",Edition=4,BookName="Java",BookNo="2018070304" },
            };

            context.Books.AddRange(seedBook);
            context.SaveChanges();
        }
    }
}
